package com.eduspace.eduplatform.wares.utils;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 异步任务线程池
 *
 * @author tbc on 2017/5/22 12:28:11.
 */
@Slf4j
public class LocalThreadPool {
    private static ExecutorService pool;

    static {
        int CPUs = Runtime.getRuntime().availableProcessors();
        pool = Executors.newFixedThreadPool(CPUs * 2);
    }

    public static void exec(Runnable runnable) {
        pool.execute(runnable);
    }


}
